<template>
  <div class="app">
    <van-nav-bar title="app标题" left-text="返回" left-arrow @click-left="onClickLeft" fixed/>
    <router-view></router-view>
    <van-tabbar v-model="active" fixed>
      <van-tabbar-item icon="home-o" to="/home">主页</van-tabbar-item>
      <van-tabbar-item icon="friends-o" to="friends">联系人</van-tabbar-item>
      <van-tabbar-item icon="cart-o" info="999" to="cart">购物车</van-tabbar-item>
      <van-tabbar-item icon="search" to="search">搜索</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script >
export default {
  data: () => ({
    active: 0
  }),
  methods: {
    onClickLeft () {
      console.log('返回上一页')
    }
  }
}
</script>
<style lang="less">
.app{
  padding-top:46px;
  padding-bottom: 50px;
}
</style>
